import React from 'react'
import { Router, Route, IndexRoute, hashHistory, Redirect } from 'react-router'
import basics from '../views/basics'
import companyIntro from '../views/companyIntro'
import productCenter from '../views/productCenter'
import news from '../views/news'
import contactUs from '../views/contactUs'
import navs from '../views/navs'
import mr from '../Layout'
import login from '../views/login'
import { isLogin } from '../configs/common'
export default () => (
    <Router history={hashHistory}>
        <Route path="/" component={ mr } onEnter={isLogin}>
            <Route path={`/basics`} component={basics} />
            <Route path={`/companyIntro`} component={companyIntro} />
            <Route path={`/productCenter`} component={productCenter} />
            <Route path={`/news`} component={news} />
            <Route path={`/contactUs`} component={contactUs} />
            <Route path={`/navs`} component={navs} />
        </Route>
        <Route path="/login" component={login} />
    </Router>
)
